package com.example.api.controller;

import com.example.api.aspect.SystemControllerLog;
import com.example.api.model.entity.Company;
import com.example.api.model.enums.ActionTypeEnum;
import com.example.api.service.CompanyService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@Api(tags = "公司管理")
@RestController
@RequestMapping("/api/company")
public class CompanyController {

    @Resource
    private CompanyService companyService;

    @ApiOperation("查询公司")
    @GetMapping("/")
    @SystemControllerLog(description = "查询公司", actionType = ActionTypeEnum.QUERY)
    public List<Company> findAll(String name) {
        return companyService.findAll(name);
    }

}
